typedef struct ListNode ListNode;
struct ListNode *getIntersectionNode(struct ListNode *headA, struct ListNode *headB)
{
    ListNode* pA = headA;
    ListNode* pB = headB;

    while (pA != pB) {
        // 如果pA走到末尾，就让他跳到headB；否则，继续前进
        pA = pA == NULL ? headB : pA->next;
        // 如果pB走到末尾，就让他跳到headA；否则，继续前进
        pB = pB == NULL ? headA : pB->next;
    }

    return pA;
}